/*  1:   */ package org.jetbrains.lang.manifest.header.impl;
/*  2:   */ 
/*  3:   */

import com.intellij.lang.PsiBuilder;
import com.intellij.lang.PsiBuilder.Marker;
import com.intellij.lang.annotation.AnnotationHolder;
import com.intellij.psi.PsiReference;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.lang.manifest.header.HeaderParser;
import org.jetbrains.lang.manifest.parser.ManifestParser;
import org.jetbrains.lang.manifest.psi.*;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */
/* 14:   */
/* 15:   */
/* 16:   */
/* 17:   */
/* 18:   */ 
/* 19:   */ public class StandardHeaderParser
/* 20:   */   implements HeaderParser
/* 21:   */ {
/* 22:41 */   public static final HeaderParser INSTANCE = new StandardHeaderParser();
/* 23:   */   
/* 24:   */   public void parse(@NotNull PsiBuilder paramPsiBuilder)
/* 25:   */   {
/* 26:45 */     if (paramPsiBuilder == null) {
/* 27:45 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/lang/manifest/header/impl/StandardHeaderParser", "parse" }));
/* 28:   */     }
/* 29:45 */     PsiBuilder.Marker localMarker = paramPsiBuilder.mark();
/* 30:46 */     while ((!paramPsiBuilder.eof()) && (!ManifestParser.HEADER_END_TOKENS.contains(paramPsiBuilder.getTokenType())))
/* 31:   */     {
/* 32:47 */       IElementType localIElementType = paramPsiBuilder.getTokenType();
/* 33:48 */       paramPsiBuilder.advanceLexer();
/* 34:49 */       if ((localIElementType == ManifestTokenType.NEWLINE) && (paramPsiBuilder.getTokenType() != ManifestTokenType.SIGNIFICANT_SPACE)) {
/* 35:   */         break;
/* 36:   */       }
/* 37:   */     }
/* 38:53 */     localMarker.done(ManifestElementType.HEADER_VALUE_PART);
/* 39:   */   }
/* 40:   */   
/* 41:   */   public boolean annotate(@NotNull Header paramHeader, @NotNull AnnotationHolder paramAnnotationHolder)
/* 42:   */   {
/* 43:58 */     if (paramHeader == null) {
/* 44:58 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/lang/manifest/header/impl/StandardHeaderParser", "annotate" }));
/* 45:   */     }
/* 46:58 */     if (paramAnnotationHolder == null) {
/* 47:58 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/lang/manifest/header/impl/StandardHeaderParser", "annotate" }));
/* 48:   */     }
/* 49:58 */     return false;
/* 50:   */   }
/* 51:   */   
/* 52:   */   @Nullable
/* 53:   */   public Object getConvertedValue(@NotNull Header paramHeader)
/* 54:   */   {
/* 55:64 */     if (paramHeader == null) {
/* 56:64 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/lang/manifest/header/impl/StandardHeaderParser", "getConvertedValue" }));
/* 57:   */     }
/* 58:64 */     HeaderValue localHeaderValue = paramHeader.getHeaderValue();
/* 59:65 */     return localHeaderValue != null ? localHeaderValue.getUnwrappedText() : null;
/* 60:   */   }
/* 61:   */   
/* 62:   */   @NotNull
/* 63:   */   public PsiReference[] getReferences(@NotNull HeaderValuePart paramHeaderValuePart)
/* 64:   */   {
/* 65:71 */     if (paramHeaderValuePart == null) {
/* 66:71 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/lang/manifest/header/impl/StandardHeaderParser", "getReferences" }));
/* 67:   */     }
/* 68:71 */     PsiReference[] tmp43_40 = PsiReference.EMPTY_ARRAY;
/* 69:71 */     if (tmp43_40 == null) {
/* 70:71 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/lang/manifest/header/impl/StandardHeaderParser", "getReferences" }));
/* 71:   */     }
/* 72:71 */     return tmp43_40;
/* 73:   */   }
/* 74:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.lang.manifest.header.impl.StandardHeaderParser

 * JD-Core Version:    0.7.0.1

 */